add_rules("mode.debug", "mode.release")

target("qemu", function()
  set_kind("phony")
  on_build(function (target)
    -- start qemu-system-i386 -m 128M -s -S  -drive file=disk.img,index=0,media=disk,format=raw
    os.exec("qemu-system-i386 -m 128M -drive file=disk.img,index=0,media=disk,format=raw")
  end)
  add_deps("a00")
end)

target("qemudbg", function()
  set_kind("phony")
  on_build(function (target)
    os.exec("qemu-system-i386 -m 128M -s -S -drive file=disk.img,index=0,media=disk,format=raw")
    -- os.exec("qemu-system-x86_64 -m 128M -s -S -hda disk.img")
  end)
  add_deps("a00")
end)

-- 以后这个应该移到 root xmake.lua 中
target("clean", function ()
  set_kind("phony")
  on_build(function ()
    os.rm("build")
    os.rm("image")
  end)
end)

includes("*/xmake.lua")
